const db = uniCloud.database();
const cmd = db.command;
//此回调函数主要实现支付回调校验，防止前端
module.exports = async (obj) => {
  let user_order_success = true;
  let {
    data = {}
  } = obj;
  let {
    order_no,
    out_trade_no,
    total_fee,
    provider
  } = data; // uni-pay-orders 表内的数据均可获取到，直接解构出想要的即可

  db.collection("ly-mall-order").where({
    order_no: order_no
  }).update({
    status: 1,
    payType: provider
  })

  return user_order_success;
}